﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace Cstudy.BLL
{
    public class resources
    {
        public bool AddRescources(MODEL.resources rescource, out int ResID)
        {
            return new DAL.resources().AddRescource(rescource, out ResID);
        }

        public bool DeleteRescource(int resid)
        {
            return new DAL.resources().DeleteRescource(resid);
        }

        public bool UpdateRescoures(MODEL.resources rescource)
        {
            return new DAL.resources().UpdateRescoures(rescource);
        }

        public DataSet SearchRescources(string keyword)
        {
            return new DAL.resources().SearchRescources(keyword);
        }

        public DataSet SelectResources(int currentpage, int pagesize, out int count)
        {
            return new DAL.resources().SelectResources(currentpage, pagesize, out count);
        }

        public DataSet SelectResourcesByClassID(int classid, int currentpage, int pagesize, out int count)
        {
            return new DAL.resources().SelectResourcesByClassID(classid, currentpage, pagesize, out count);
        }

        public DataSet SelectResourceByResID(int resid, bool isview)
        {
            if (isview)
                new DAL.resources().AddResVisitTime(resid);
            return new DAL.resources().SelectResourceByResID(resid);
        }

        public DataSet SelectHotRes(int count)
        {
            return new DAL.resources().SelectHotRes(count);
        }
    }
}
